A remote virtual user interface provided by a remote virtual desktop system running on a server side is delivered using the Remote Desktop Protocol to various local terminals for use by a user on a terminal side. In addition, using the Remote Desktop Protocol, various physical peripherals connected to the terminal side can be mapped to the remote virtual desktop system on the server side, and virtual peripherals of the peripherals can be displayed on a remote virtual desktop provided for the terminal side, so that a user can implement an operation on a physical peripheral by performing an operation on the virtual device on the terminal side. The Remote Desktop Protocol involves interaction between the terminal side and the server side. The protocol is internally divided into different interactive services according to different functions for implementation. For a universal serial bus (USB) service, a physical USB device connected to the terminal side is also mapped to the remote virtual desktop by means of interaction between the terminal side and the server side, and a corresponding virtual USB device is obtained by means of mapping on the remote virtual desktop for user operation.
FIG. 1 is a USB redirection framework provided by the common Remote Desktop Protocol, where the USB redirection framework is divided into a terminal side and a server side. A framework body includes four parts: a USB universal driver, a USB client, a USB server, and a USB virtual bus driver. Referring to FIG. 1, the USB universal driver and the USB client are located on the terminal side of the redirection framework, and the USB server and the USB virtual bus driver are located on the server side of the redirection framework. The USB universal driver works in a kernel mode on the terminal side, and is loaded and initialized by an operating system (OS), so as to obtain device information of an inserted USB device, so that the USB client reads the device information from the USB universal driver. A virtual channel is established between the USB client and the USB server, and the USB server interacts with the USB client. The USB virtual bus driver works in a kernel mode on the server side, and is loaded and initialized by a virtual desktop system, and provides a capability of dynamically creating or deleting a virtual USB device to the USB server.
Based on the USB redirection framework provided in FIG. 1, when a physical USB device is inserted into the terminal side, the USB universal driver detects an insertion event of the physical USB device. Then, the USB client reads device information of the USB device from the USB universal driver, and uploads the read device information to the USB server. The USB server serves as a process or a thread that provides a USB service (which is a system service) in the remote virtual desktop system. After receiving the device information, the USB server determines, according to a redirection mapping policy, whether to support mapping of the USB device to the remote virtual desktop. If mapping of the USB device to the remote virtual desktop is supported, the USB server delivers a USB device redirection enabling notification to the USB client on the terminal side so that the USB client forwards the redirection enabling notification to the USB universal driver. The USB universal driver enables redirection of a USB message according to the redirection enabling notification, and feeds back an enabling result to the USB server using the USB client. The server learns, according to the enabling result, that the USB device successfully enables the redirection function, and then creates a virtual device of the USB device (namely, the virtual USB device in FIG. 1) using the USB virtual bus driver.
After the inserted physical USB device is successfully mapped into the virtual USB device in the remote virtual desktop system, if the USB virtual bus driver obtains an I/O request operation or another access control operation of a user for the virtual USB device, the USB virtual bus driver encapsulates the access control operation into operation request information, so that the USB server reads the operation request message. The USB server delivers the operation request message to the USB client, so that the USB client forwards the operation request message to the USB universal driver. The USB universal driver forwards the operation request message to the inserted physical USB device for processing. The following problems may exist in a process of implementing the prior art.
Because the USB universal driver on the terminal side is basically redirected completely according to a standard USB protocol specification, if the physical USB device is not designed according to the standard USB protocol specification, the physical USB device cannot perform correct redirection according to the operation request message, or even cannot implement redirection according to the operation request message, affecting normal use of the physical USB device by a user.